﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebApplication1.ServiceReference1;
using System.Data.Services.Client;
namespace WebApplication1
{
    public partial class Arbitri : System.Web.UI.Page
    {
        private Uri serviceUri = new Uri("http://localhost:50000/FootballService.svc/");
        WebApplication1.ServiceReference1.FotbalEntities context;

        protected void Page_Load(object sender, EventArgs e)
        {
            context = new WebApplication1.ServiceReference1.FotbalEntities(serviceUri);
            if (!IsPostBack)
            {
               
                BindArbitri();
            }
        }

        private void BindArbitri()
        {
            DataServiceQuery<WebApplication1.ServiceReference1.Arbitri> arbitri =
            context.CreateQuery<WebApplication1.ServiceReference1.Arbitri>("/Arbitris");

            var query = from a in arbitri
                        select a;

            ListView_ListaArbitri.DataSource = query;
            ListView_ListaArbitri.DataBind();
        }

        }
    }
